<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">-->
<!--<html>-->
<!--<head>-->
    <!--<title>添加权限</title>-->
    <!--<meta http-equiv="content-type" content="text/html;charset=utf-8">-->
    <!--<link href="{$smarty.const.ADMIN_CSS_URL}mine.css" type="text/css" rel="stylesheet">-->
    <!--<style type="text/css">-->
        <!--{literal}-->
        <!--li{list-style: none;}-->
        <!--{/literal}-->
    <!--</style>-->
<!--</head>-->

<!--<body>-->

<!--<div class="div_head">-->
            <!--<span>-->
                <!--<span style="float:left">当前位置是：权限管理-》添加权限信息</span>-->
                <!--<span style="float:right;margin-right: 8px;font-weight: bold">-->
                    <!--<a style="text-decoration: none" href="{$smarty.const.__MODULE__}/Goods/showlist">【返回】</a>-->
                <!--</span>-->
            <!--</span>-->
<!--</div>-->
<!--<div></div>-->

<!--<div style="font-size: 13px;margin: 10px 5px">-->
    <!--<form action="{$smarty.const.__SELF__}" method="post" enctype="multipart/form-data">-->
        <!--<div>正在为角色：<span style="font-size:25px; font-weight:bold;">{$role_name}</span>分配权限</div>-->
        <!--{*首先显示父级权限，在内部嵌套判断显示对应的子级权限 ul  li*}-->
        <!--<ul>-->
            <!--{foreach $pauth_info as $k => $v}-->
            <!--<li>{$v.auth_name}<input type="checkbox" name="authname[]" value="{$v.auth_id}" {if in_array($v.auth_id,$auth_ids_arr) }checked='checked'{/if} />-->
            <!--{/foreach}-->
        <!--</ul>-->
        <!--<input type="submit" value="分配权限" />-->
    <!--</form>-->
<!--</div>-->
<!--</body>-->
<!--</html>-->

<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <script type='text/javascript' src='{$smarty.const.ADMIN_JS_URL}jquery-1.4.2.min.js'></script>
    <script type='text/javascript' src='{$smarty.const.ADMIN_JS_URL}jquery.checktree.js'></script>
    <script>
        $(document).ready(function(){
            $("ul.tree").checkTree({
                /*
                 // You can add callbacks to the expand, collapse, check, uncheck, and  halfcheck
                 // events of the tree. The element you use as the argument is the LI element of
                 // the object that fired the event.
                 onExpand: function(el) {
                 console.log("expanded ", el.find("label:first").text());
                 },
                 onCollapse: function(el) {
                 console.log("collapsed ", el.find("label:first").text());
                 },
                 onCheck: function(el) {
                 console.log("checked ", el.find("label:first").text());
                 },
                 onUnCheck: function(el) {
                 console.log("un checked ", el.find("label:first").text());
                 },
                 onHalfCheck: function(el) {
                 console.log("half checked ", el.find("label:first").text());
                 }*/
                /*
                 // You can set the labelAction variable to either "check" or "expand"
                 // to change what happens when you click on the label item.
                 // The default is expand, which expands the tree. Check will toggle
                 // the checked state of the items.
                 labelAction: "expand"
                 */
                /*
                 // You can also change what happens when you hover over a label (over and out)
                 onLabelHoverOver: function(el) { alert("You hovered over " + el.text()); },
                 onLabelHoverOut: function(el) { alert("You hovered out of " + el.text()); }
                 */
            });
        });
    </script>
    <link href="{$smarty.const.ADMIN_CSS_URL}checktree.css" type="text/css" rel="stylesheet">
    <link rel="stylesheet" href="{$smarty.const.ADMIN_CSS_URL}right.css"/>
</head>

<body style="background: url('{$smarty.const.ADMIN_IMG_URL}waver.png')">

<div class="right_title">
    <div class="right_location">
        当前位置是：角色管理>>>>>>分配权限信息
    </div>
    <hr size="1px" width=100% color="#419df9" noshade="noshade" />
    <form action="{$smarty.const.__SELF__}" method="post" enctype="multipart/form-data">
        <div class="role_right">
            正在为角色：{$role_name} 分配权限
        </div>
        <hr size="5px" width=100% color="#419df9" noshade="noshade" /><br/>
        <ul class="tree" style="margin-left: 15px;">
            {foreach $pauth_info as $k => $v}
            <div class="role_info">
            <li>{$v.auth_name}<input type="checkbox" name="authname[]" value="{$v.auth_id}" {if in_array($v.auth_id,$auth_ids_arr) }checked='checked'{/if} />
                <ul>
                    {foreach $sauth_info as $kk => $vv}
                    {if $vv.auth_pid == $v.auth_id}
                    <li>{$vv.auth_name}<input type="checkbox" name="authname[]" value="{$vv.auth_id}" {if in_array($vv.auth_id,$auth_ids_arr) }checked='checked'{/if}/>
                        <ul>
                            {foreach $tauth_info as $kkk => $vvv}
                            {if $vvv.auth_pid == $vv.auth_id}
                            <li>{$vvv.auth_name}<input type="checkbox" name="authname[]" value="{$vvv.auth_id}" {if in_array($vvv.auth_id,$auth_ids_arr) }checked='checked'{/if}/></li>
                            {/if}
                            {/foreach}
                        </ul>
                    </li>
                    {/if}
                    {/foreach}
                </ul>
            </li>
            </div>
            {/foreach}
        </ul>
        <div class="manager_btn">
            <input class="btn" type="submit" value="分配权限" /><br/><br/>
        </div>
    </form>
</div>

</body>
</html>

